﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace _5_30_OC_OD
{
    public partial class Form2 : Form
    {
        public Form2()
        {
            InitializeComponent();
            
        }


        private void Form2_Load(object sender, EventArgs e)
        {

            pictureBox1.Image = imageList1.Images[0];
        }

        private void Form2_Resize(object sender, EventArgs e)
        {
            // 获取图片控件当前的宽高比
            double ratio = (double)pictureBox1.Width / (double)pictureBox1.Height;

            // 设置控件的宽等于窗体的宽
            pictureBox1.Width = this.Width;

            // 根据宽高比计算控件的高
            pictureBox1.Height = (int)(pictureBox1.Width / ratio);
        }

        private void pictureBox1_Click(object sender, EventArgs e)
        {

        }
    }
}
